package com.masterlu.leetcode.everyday.linkedlist.simple;

/**
 * 力扣1063号题
 * 设计停车系统
 * https://leetcode-cn.com/problems/design-parking-system/
 *
 * @Author：masterlu
 * @Date：2021/3/19 9:33 上午
 */
public class S1603ParkingSystem {

    private int big;
    private int medium;
    private int small;

    public S1603ParkingSystem(int big,int medium,int small){

        this.big = big;
        this.medium = medium;
        this.small = small;
    }

    public boolean addCar(int catType){

        switch (catType){
            case 1:
                if (big > 0){
                    big --;
                    return true;
                }else {
                    return false;
                }

            case 2:
                if (medium > 0){
                    medium --;
                    return true;
                }else {
                    return false;
                }
            case 3:
                if (small > 0){
                    small --;
                    return true;
                }else {
                    return false;
                }
            default:
                return false;
        }

    }

    private boolean checkNumber(int number) {
        if (number > 0){
            big --;
            return true;
        }else {
            return false;
        }
    }

}
